﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Apq_DBTools.Forms
{
	public class ContextMySqlDataCompare:ContextCompare
	{
		public ContextMySqlDataCompare()
		{
			Steps.Add(new Step1Context(this));
			Steps.Add(new Step2Context(this));
		}

		#region Step1Context
		/// <summary>
		/// 第1步:数据库连接设置
		/// </summary>
		public class Step1Context : ContextCompare.StepContext
		{
			public Step1Context(ContextMySqlDataCompare context)
				: base(context)
			{
			}

			public override void CalcNext()
			{
				if (_context.Step == 1)
				{
					if (NeedRecalcForwad)
					{
						base.CalcNext();
					}
				}
			}

			private string _ProjectName;
			public string ProjectName
			{
				get { return _ProjectName; }
				set { _ProjectName = value; }
			}
			private List<string> _ProjectNames;
			private List<string> ProjectNames
			{
				set { _ProjectNames = value; }
				get { return _ProjectNames; }
			}

			private string _Title;
			public string Title
			{
				set { _Title = value; }
				get { return _Title; }
			}
			private int _TabPageIndex;
			public int TabPageIndex
			{
				set { _TabPageIndex = value; }
				get { return _TabPageIndex; }
			}

			#region 左侧
			private string _Name1;
			public string Name1
			{
				get { return _Name1; }
				set { _Name1 = value; }
			}
			private List<string> _Names1;
			public List<string> Names1
			{
				set { _Names1 = value; }
				get { return _Names1; }
			}

			private string _Server1;
			public string Server1
			{
				set { _Server1 = value; }
				get { return _Server1; }
			}
			private string _UserId1;
			public string UserId1
			{
				set { _UserId1 = value; }
				get { return _UserId1; }
			}
			private string _Pwd1;
			public string Pwd1
			{
				set { _Pwd1 = value; }
				get { return _Pwd1; }
			}
			private bool _SavePwd1;
			public bool SavePwd1
			{
				set { _SavePwd1 = value; }
				get { return _SavePwd1; }
			}
			private int _Port1;
			public int Port1
			{
				set { _Port1 = value; }
				get { return _Port1; }
			}

			private string _DBName1;
			public string DBName1
			{
				get { return _DBName1; }
				set { _DBName1 = value; }
			}
			private List<string> _DBNames1;
			public List<string> DBNames1
			{
				get { return _DBNames1; }
				set { _DBNames1 = value; }
			}

			private bool _btnSave1_Enabled;
			public bool btnSave1_Enabled
			{
				get { return _btnSave1_Enabled; }
				set { _btnSave1_Enabled = value; }
			}
			#endregion

			#region 右侧
			private string _Name2;
			public string Name2
			{
				get { return _Name2; }
				set { _Name2 = value; }
			}
			private List<string> _Names2;
			public List<string> Names2
			{
				set { _Names2 = value; }
				get { return _Names2; }
			}

			private string _Server2;
			public string Server2
			{
				set { _Server2 = value; }
				get { return _Server2; }
			}
			private string _UserId2;
			public string UserId2
			{
				set { _UserId2 = value; }
				get { return _UserId2; }
			}
			private string _Pwd2;
			public string Pwd2
			{
				set { _Pwd2 = value; }
				get { return _Pwd2; }
			}
			private bool _SavePwd2;
			public bool SavePwd2
			{
				set { _SavePwd2 = value; }
				get { return _SavePwd2; }
			}
			private int _Port2;
			public int Port2
			{
				set { _Port2 = value; }
				get { return _Port2; }
			}

			private string _DBName2;
			public string DBName2
			{
				get { return _DBName2; }
				set { _DBName2 = value; }
			}
			private List<string> _DBNames2;
			public List<string> DBNames2
			{
				get { return _DBNames2; }
				set { _DBNames2 = value; }
			}

			private bool _btnSave2_Enabled;
			public bool btnSave2_Enabled
			{
				get { return _btnSave2_Enabled; }
				set { _btnSave2_Enabled = value; }
			}
			#endregion
		}
		#endregion

		#region Step2Context
		/// <summary>
		/// 第2步:数据库对象列表和表列映射
		/// </summary>
		public class Step2Context : ContextCompare.StepContext
		{
			public Step2Context(ContextMySqlDataCompare context)
				: base(context)
			{
			}
		}
		#endregion
	}
}
